import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    name:'陈亚东',
    age:'23',
    sex:'男',
    major:'物联网工程',
    phoneNum:'1252588776',
    profession:'准程序员',
    desc:['男','女']
  },
  getters:{
    phoneShow:state=>{
      return state.phoneNum.substring(0,3)+'****'+state.phoneNum.substring(7,11)
    },
    sexShow:state=>{
      return sex=>{
        return state.desc[sex]
      }
    }
  },
  mutations: {

  },
  actions: {

  },
  modules: {

  }
})
